/******************************************************************************
*  Filename:       rf_patch_cpe_ieee_coex.c
*
*  Description: RF core patch for IEEE 802.15.4-Coex support ("IEEE" API command set) in CC13x2 and CC26x2
*
*  Copyright (c) 2015-2022, Texas Instruments Incorporated
*  All rights reserved.
*
*  Redistribution and use in source and binary forms, with or without
*  modification, are permitted provided that the following conditions are met:
*
*  1) Redistributions of source code must retain the above copyright notice,
*     this list of conditions and the following disclaimer.
*
*  2) Redistributions in binary form must reproduce the above copyright notice,
*     this list of conditions and the following disclaimer in the documentation
*     and/or other materials provided with the distribution.
*
*  3) Neither the name of the ORGANIZATION nor the names of its contributors may
*     be used to endorse or promote products derived from this software without
*     specific prior written permission.
*
*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
*  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
*  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
*  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
*  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
*  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
*  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
*  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
*  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
*  POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>
#include <string.h>

#include "rf_patch_cpe_ieee_coex.h"

#ifndef CPE_PATCH_TYPE
#define CPE_PATCH_TYPE static const uint32_t
#endif

#ifndef SYS_PATCH_TYPE
#define SYS_PATCH_TYPE static const uint32_t
#endif

#ifndef PATCH_FUN_SPEC
#define PATCH_FUN_SPEC static
#endif

#ifndef _APPLY_PATCH_TAB
#define _APPLY_PATCH_TAB
#endif


CPE_PATCH_TYPE patchImageIeeeCoex[] = {
   0x2100406d,
   0x21004099,
   0x210040a5,
   0x2100416b,
   0x21004ccd,
   0x21004cef,
   0x21004d0f,
   0x21004d8d,
   0x79654c07,
   0xf809f000,
   0x40697961,
   0xd5030749,
   0x4a042101,
   0x60110389,
   0xb570bd70,
   0x47084902,
   0x21000380,
   0x40041108,
   0x0000592d,
   0xf816f000,
   0x47004800,
   0x00007f57,
   0xf816f000,
   0x47004800,
   0x0000881b,
   0x4700b570,
   0x4700b5f8,
   0xb082b5f7,
   0x47204c00,
   0x000006bd,
   0x4700b5f8,
   0x490c6b80,
   0x0f000700,
   0x47707148,
   0x490a4a09,
   0x79502318,
   0x7e4956cb,
   0x428118c0,
   0x4608dd01,
   0x280fe002,
   0x200fdd00,
   0x090989d1,
   0x43010109,
   0x477081d1,
   0x210002e0,
   0x21000088,
   0x4b302201,
   0x482e2102,
   0xb5104718,
   0xfe59f000,
   0x4780482d,
   0x6a40482d,
   0xd10d2800,
   0x200a492c,
   0x28005608,
   0x1c40da09,
   0x4608d007,
   0x6a403820,
   0x42884928,
   0x4780d100,
   0xf7ffbd10,
   0xbd10ffe1,
   0x4b262100,
   0x46084a24,
   0x20014718,
   0x02404924,
   0x48246008,
   0x780122fb,
   0x40114b20,
   0x21137001,
   0x20014a21,
   0xb5704718,
   0x46064920,
   0x4d184788,
   0x3d204604,
   0xd0082801,
   0xd5040420,
   0x85282000,
   0x6268481b,
   0x46202401,
   0x4630bd70,
   0xf953f000,
   0x480d6a69,
   0x428138ec,
   0x4816d101,
   0x6a68e005,
   0x393e4909,
   0xd1024288,
   0x62684813,
   0x4807e7eb,
   0x4a126a41,
   0xd1e64291,
   0x62414911,
   0x0000e7e3,
   0x00000806,
   0x0000069f,
   0x000292a1,
   0x21000108,
   0x21000154,
   0x00029263,
   0x2100410f,
   0x0002b4b5,
   0xe000e180,
   0x21000380,
   0x210046ed,
   0x000296f7,
   0x21004105,
   0x2100414f,
   0x21004921,
   0x00029569,
   0x21004145,
   0x22ff0783,
   0x409a0edb,
   0x0e090789,
   0x28004099,
   0x0700da0b,
   0x38080f00,
   0x009b0883,
   0x181848ff,
   0x439369c3,
   0x61c3430b,
   0x08834770,
   0x009b48fc,
   0x68031818,
   0x430b4393,
   0x47706003,
   0x4684b5f0,
   0x7bc048f8,
   0xd07c2800,
   0x69634cf7,
   0xd0782b00,
   0x07f0781e,
   0xd0740fc0,
   0xd0722b00,
   0x25047858,
   0xd0072800,
   0x28012705,
   0x2802d006,
   0x2803d006,
   0xe006d109,
   0xe00272e5,
   0xe00372e5,
   0x72a572e7,
   0x72e7e001,
   0x08f072a7,
   0x4fe94de8,
   0xd04307c0,
   0x42014660,
   0x8858d040,
   0x0c010480,
   0x02002005,
   0xd0012a00,
   0xe0007aa2,
   0x2a057ae2,
   0x2900d021,
   0x69aad02e,
   0x181243ba,
   0x686861aa,
   0x4686696a,
   0x0200200f,
   0x32ff4382,
   0x320232ff,
   0x48d7616a,
   0x30402201,
   0x69aa6082,
   0x32ff43ba,
   0x320232ff,
   0x4ad261aa,
   0x32804471,
   0x7a606091,
   0xd0052801,
   0x69a9e00e,
   0x180843b9,
   0xe00961a8,
   0x4acd2002,
   0x03417260,
   0x4acc6011,
   0x4aca6011,
   0x60113a80,
   0x21017860,
   0x70604308,
   0x07c00870,
   0x4660d011,
   0x28002208,
   0x786049c5,
   0x0785d00c,
   0x694dd409,
   0x614d4315,
   0x43082102,
   0x79187060,
   0x43082101,
   0xbdf07118,
   0xd5fc0786,
   0x4396694e,
   0x21fd614e,
   0x79194008,
   0x00490849,
   0x69a97119,
   0x43b92201,
   0x18890292,
   0x084061a9,
   0x70600040,
   0x49afbdf0,
   0x4aaf2800,
   0x69884bac,
   0x4390d002,
   0xe0017a9a,
   0x7ada4390,
   0x43100212,
   0x47706188,
   0x49a5b530,
   0x29007bc9,
   0x49a3d04a,
   0x31404ba3,
   0x615a69ca,
   0xd0432a00,
   0x79514ca6,
   0x24011900,
   0xd0092800,
   0x1b4002a5,
   0x2801d004,
   0x2802d01b,
   0xe036d124,
   0xe0177a50,
   0x70dc7990,
   0x0fe40704,
   0x0784711c,
   0x719c0fe4,
   0x07e4088c,
   0x070cd002,
   0x719c0fe4,
   0x0fc007c0,
   0x07c873d8,
   0x0788d00e,
   0x73d80fc0,
   0x7a10e00a,
   0x070470dc,
   0x711c0fe4,
   0x0fe40784,
   0x715c07c0,
   0x73980fc0,
   0x24fd7910,
   0x78dc4020,
   0x43200064,
   0x08887110,
   0xd00207c0,
   0x0fc00708,
   0x07c87158,
   0x0788d002,
   0x73980fc0,
   0x79d0bd30,
   0x4983e7e0,
   0x42498800,
   0xd0084288,
   0x42884981,
   0x1c49d005,
   0xd0024288,
   0x42881c49,
   0xe79dd100,
   0xb5f04770,
   0x4a734694,
   0x2a007bd2,
   0x4c72d03f,
   0x2a006962,
   0x7813d03b,
   0x0fed07dd,
   0x2a00d037,
   0x089ad035,
   0x270107d2,
   0x74a02500,
   0xd0012a00,
   0xe00070a7,
   0x085a70a5,
   0xd01f07d2,
   0x74677427,
   0xd11e2800,
   0x74227962,
   0x40327ba6,
   0x29007462,
   0x79a2d104,
   0x7be67422,
   0x74624032,
   0x46664a5e,
   0x2e0079d2,
   0x7c26d004,
   0x4316408e,
   0xe00871e6,
   0x43ba408f,
   0x742571e2,
   0xe002d109,
   0x74657425,
   0x786171e5,
   0x42114662,
   0xf7ffd002,
   0xbdf0ff48,
   0x07c908d9,
   0x7465d100,
   0x7c614602,
   0xf7ff7c20,
   0xbdf0fea5,
   0xb5104b4c,
   0x4619789a,
   0x78c94614,
   0xd0024384,
   0x430b795b,
   0x2a00d011,
   0x4381d00f,
   0x2001d10d,
   0x03c0494c,
   0x484b60c8,
   0x6ac03840,
   0xd5040400,
   0xf0002011,
   0x2000fcad,
   0x2001bd10,
   0xb5f8bd10,
   0x25004c3c,
   0x7a926962,
   0x29020092,
   0x7ac1d011,
   0x7b5b4623,
   0xd00e2916,
   0xd0162915,
   0xd0012914,
   0xd1072917,
   0xd0052b00,
   0x21012200,
   0xf7ff4610,
   0x7365ff76,
   0x4938bdf8,
   0x07497809,
   0x2201d505,
   0x20004611,
   0xff6bf7ff,
   0x2b00bdf8,
   0x2101d1fc,
   0x73614b2b,
   0x601e030e,
   0x601e4b2a,
   0x37404f26,
   0x6a406039,
   0x1a8161a0,
   0x30804823,
   0x68016001,
   0x68404821,
   0xfc72f000,
   0xd0012800,
   0xe7de603d,
   0x3880481f,
   0xbdf86006,
   0xb510491b,
   0x31404823,
   0x48196048,
   0x220268c1,
   0x60c14311,
   0x03144819,
   0x21006004,
   0xf7ff200d,
   0x4912fe11,
   0x73082001,
   0x6ac1481b,
   0x431100a2,
   0x481162c1,
   0x60043880,
   0xb570bd10,
   0x480e2401,
   0x600403a4,
   0x6004480d,
   0x69414809,
   0x0212220f,
   0x61414311,
   0x21014d06,
   0x60a93540,
   0xe01d4903,
   0xe000ed00,
   0xe000e400,
   0x210000a8,
   0x21004f64,
   0x40043000,
   0x00000700,
   0xe000e180,
   0xe000e280,
   0x40041100,
   0xffffd7ff,
   0x00002c01,
   0x40045040,
   0x21000380,
   0x00001702,
   0x40046080,
   0x22296a09,
   0x188a0112,
   0x608a49ff,
   0x68406889,
   0xfc12f000,
   0xd0032800,
   0x60a82000,
   0x600448fb,
   0x600448fb,
   0xb570bd70,
   0x21004dfa,
   0x28007a28,
   0x4af5d103,
   0x68523a80,
   0x1c40622a,
   0x4af2b2c0,
   0x68547228,
   0x2a021e82,
   0x69ead81d,
   0x3a381aa2,
   0xd8152a10,
   0xd1162804,
   0x680048ef,
   0x42904aef,
   0x2101d100,
   0x72682001,
   0x20004602,
   0xfec5f7ff,
   0x28017a68,
   0x2003d107,
   0xf7ff7268,
   0xe002ff90,
   0x72282000,
   0xbf007268,
   0xbd7061ec,
   0x48e5b5f8,
   0x7ac04ce3,
   0x07812500,
   0x29002602,
   0x48e2da03,
   0x72a68120,
   0x07c0e006,
   0x48dfd006,
   0x81201f40,
   0x72a02000,
   0xe0092503,
   0x46204629,
   0xff0df7ff,
   0x47806860,
   0xd0f70005,
   0xd0512d01,
   0x6a784fd7,
   0xd0012800,
   0x47806a78,
   0x302048d4,
   0x5641210a,
   0xd0031c89,
   0x5641210a,
   0xd1091cc9,
   0x49d06838,
   0x42888800,
   0x6838d00a,
   0x88001c49,
   0xd0054288,
   0x1e4048c9,
   0x72a68120,
   0xe0032503,
   0xd0012d03,
   0xd12d2d02,
   0x382048c3,
   0x2d036806,
   0x2002d114,
   0xfb90f000,
   0x388048b8,
   0x69e16845,
   0xf0004628,
   0x2800fb83,
   0x2000d001,
   0x48bee005,
   0x69e08941,
   0xf0001b40,
   0x81e0fb85,
   0x757089e0,
   0x61b06a20,
   0x6a2148b4,
   0x61813820,
   0x75b07b60,
   0x89207aa1,
   0xf0002201,
   0x6a78fb7b,
   0xd0012800,
   0x47806a78,
   0x48a9bdf8,
   0x49b06800,
   0xd10d4288,
   0x49a32001,
   0x39800300,
   0x48a66008,
   0x7b0038e0,
   0xd0052802,
   0x46112201,
   0xe6302000,
   0x470048a8,
   0xb5f84770,
   0x4c9f48a0,
   0x25007ac0,
   0x26020780,
   0xda032800,
   0x8120489d,
   0x250372a6,
   0x78c048a1,
   0xd0042800,
   0x1c40489b,
   0x72a68120,
   0xb6722503,
   0x300120ff,
   0xfb4af000,
   0x4f8fb662,
   0x7838e00a,
   0xd0042800,
   0xf0002024,
   0x2503fb23,
   0x6860e004,
   0x46054780,
   0xd0f22d00,
   0x20ffb672,
   0xf0003001,
   0xb662fb3b,
   0x7840488f,
   0xd00f2800,
   0x6840488e,
   0xd50b0740,
   0x6800487f,
   0xd5070700,
   0xf0002041,
   0x4884fb07,
   0x81201d00,
   0x250372a6,
   0x28007838,
   0x2000d009,
   0x205a7338,
   0xfafaf000,
   0x1d40487d,
   0x72a68120,
   0x2d03e004,
   0x2d02d002,
   0xbdf8d006,
   0xfb18f000,
   0xfb1cf000,
   0xfb20f000,
   0x89207aa1,
   0xf0002201,
   0x486dfafd,
   0x29006801,
   0x6800d0ef,
   0xbdf84780,
   0x4607b5f8,
   0x48652401,
   0x38800424,
   0x4d626004,
   0x3d402600,
   0x4861612e,
   0x60043080,
   0x20104631,
   0xfc8af7ff,
   0x61282001,
   0x6107485b,
   0x485a6901,
   0x68403880,
   0xfac8f000,
   0xd0062800,
   0x2201612e,
   0x46104611,
   0xfda1f7ff,
   0x4855bdf8,
   0xbdf86004,
   0x4c5ab510,
   0x200a3420,
   0x1c805620,
   0x7ae0d113,
   0x43082120,
   0x400821bf,
   0x485472e0,
   0x29006a41,
   0x6a40d001,
   0x200a4780,
   0x1cc05620,
   0x484cd12a,
   0x38e02102,
   0x49477301,
   0x70082000,
   0x07807848,
   0x6949d418,
   0x7a89484b,
   0x4a4638a0,
   0x3a200089,
   0x6a128c00,
   0x1812460b,
   0x42833314,
   0x1a50d204,
   0xf7ff3814,
   0xe008ffa5,
   0x46112201,
   0xf7ff4610,
   0xe002fd64,
   0xf7ff2001,
   0x2118fcee,
   0x4a424b43,
   0x47982001,
   0xb510bd10,
   0x4c334941,
   0x8005f3ef,
   0xd004281e,
   0x8005f3ef,
   0xd0222820,
   0x483de036,
   0x28047d00,
   0x0300d132,
   0x492a6008,
   0x28027a48,
   0x2803d002,
   0xe029d005,
   0x72482003,
   0xfe0ff7ff,
   0x4835bd10,
   0x280e7800,
   0x2000d020,
   0x72087248,
   0x68204601,
   0x42904a21,
   0x2101d100,
   0x46102200,
   0x2001e011,
   0x60080400,
   0x20102101,
   0xfbfcf7ff,
   0x49256820,
   0xd0034288,
   0x49286820,
   0xd1054288,
   0x46112201,
   0xf7ff4610,
   0xbd10fd18,
   0x8005f3ef,
   0xf000381e,
   0x6820fa67,
   0xd0f62800,
   0x47806820,
   0xb5f8bd10,
   0x7b304e0b,
   0x4c192700,
   0xd0052800,
   0x38404805,
   0x0a006840,
   0xd0352817,
   0x7d054815,
   0x47804817,
   0xe02d2d06,
   0x40043080,
   0xe000e200,
   0xe000e100,
   0x21004f64,
   0x210002a8,
   0x00028fe7,
   0x21000240,
   0x21000154,
   0x00002407,
   0x21000108,
   0x00002801,
   0x210000c8,
   0x210046ed,
   0x00000b73,
   0x21000380,
   0x40045080,
   0x210047ff,
   0x0002b4b5,
   0xe000e180,
   0x210002c0,
   0x21000018,
   0x21004921,
   0x000074f5,
   0xe033d02c,
   0x21014ade,
   0x70316051,
   0x48dc7337,
   0x30402303,
   0x25616003,
   0x60c5016d,
   0x61436041,
   0x019b2359,
   0x61816203,
   0x62102007,
   0x684849d5,
   0x684a3018,
   0xd3fc4282,
   0xf0002000,
   0x48d2fa07,
   0x22026941,
   0x61414391,
   0x48cdbf00,
   0x6ac13080,
   0x0c490449,
   0x031062c1,
   0xbdf86020,
   0x280078b0,
   0x7830d0fb,
   0xd1f82800,
   0xfd4af7ff,
   0xd1f42d04,
   0xfda7f7ff,
   0x780048c5,
   0xd1ee280e,
   0x60200328,
   0x210048c3,
   0x4ac36800,
   0xd1004290,
   0x72772101,
   0x20002201,
   0xfc7ff7ff,
   0xbdf87237,
   0x48b8b5f8,
   0x4fbd6ac0,
   0x4ebe4dbd,
   0xd00107c1,
   0xe0592403,
   0x0f840700,
   0xd0042c01,
   0xd1072c02,
   0x28007fb8,
   0x2001d14c,
   0xfcb8f7ff,
   0xd0042800,
   0xd0282c01,
   0xd0232c02,
   0x4caae03f,
   0x60602001,
   0x48b14601,
   0xf9baf000,
   0x210120a1,
   0xf0000100,
   0x20c3f9b5,
   0x01002101,
   0xf9b6f000,
   0x62202007,
   0x20012403,
   0x20007030,
   0x489e7330,
   0x6ac13080,
   0x0c490449,
   0x200162c1,
   0x034049a4,
   0xe0236008,
   0x28007fb8,
   0x2001d11c,
   0xf992f000,
   0x08407ae8,
   0xd01007c0,
   0x07c07870,
   0x4993d008,
   0x22076988,
   0x43900212,
   0x02127ab2,
   0x61884310,
   0x6941488f,
   0x43112202,
   0x2c026141,
   0x2c03d002,
   0xe026d004,
   0xf0002001,
   0xe022f987,
   0x73302000,
   0x30804885,
   0x04496ac1,
   0x62c10c49,
   0x200d2101,
   0xfae4f7ff,
   0x20004981,
   0x60483140,
   0x4e882001,
   0x60300340,
   0xf0002000,
   0x2001f96f,
   0x60300280,
   0x08407ae8,
   0xd00407c0,
   0x69414879,
   0x43912202,
   0x77bc6141,
   0xb510bdf8,
   0x6ac04873,
   0xd02407c0,
   0x7bc14878,
   0x29002000,
   0x4a77d01f,
   0x29006951,
   0x7808d003,
   0x0fc907c1,
   0x4976d017,
   0x06c06809,
   0x17c06849,
   0xd1104208,
   0x2001496b,
   0x4b726809,
   0xd1004299,
   0x21012000,
   0x79d04081,
   0x71d04388,
   0x46112200,
   0xf7ff4610,
   0x486cfabf,
   0xbd104780,
   0x2400b510,
   0xf7ff486a,
   0x485ff9ed,
   0x495f6800,
   0xd1004288,
   0x22002401,
   0x46104621,
   0xfbb7f7ff,
   0xb510bd10,
   0x6a40485f,
   0x42884958,
   0x2200d004,
   0x46104611,
   0xfbabf7ff,
   0x38b4485d,
   0xf9d4f7ff,
   0xb5f7bd10,
   0x26014853,
   0x20007bc4,
   0x40964f52,
   0x2c004615,
   0x6979d017,
   0xd0032900,
   0x07c47808,
   0xd0100fe4,
   0x793a7839,
   0xd1024391,
   0x07c00900,
   0x79f8d109,
   0x43b02200,
   0x461171f8,
   0xf7ff4610,
   0x2000fa7b,
   0x462a7038,
   0x98009901,
   0xf9aef7ff,
   0xd0012d00,
   0xe0004d43,
   0x68284d46,
   0x2058b281,
   0xf8e8f000,
   0xd00a2c00,
   0x28006828,
   0x79f8d107,
   0x43b02200,
   0x461171f8,
   0xf7ff4610,
   0xbdfefa5d,
   0x4d3db570,
   0x483d2400,
   0xf996f7ff,
   0x7d683520,
   0xd0062800,
   0x20004930,
   0x22017008,
   0x46104601,
   0x4829e008,
   0x49296800,
   0xd1004288,
   0x22002401,
   0x46104621,
   0xfb4bf7ff,
   0xb570bd70,
   0x25004825,
   0x28007bc0,
   0x4924d037,
   0x28006948,
   0x7800d003,
   0x0fc007c0,
   0x4c28d02f,
   0x380e7ae0,
   0xd82a2804,
   0x4e157808,
   0xd0192800,
   0x07c06af0,
   0x2501d016,
   0xf87cf000,
   0x20204912,
   0x20006088,
   0xf8a0f000,
   0x6840480e,
   0x39804913,
   0x18408cc9,
   0x61602100,
   0xf89cf000,
   0x46216822,
   0x47902002,
   0x28127ae0,
   0x6af0d102,
   0xd10107c0,
   0xd0042d00,
   0x46112200,
   0xf7ff4610,
   0xbd70fb0c,
   0x40046000,
   0x40043000,
   0x40041100,
   0x21000018,
   0x210002a8,
   0x00028fe7,
   0x210002a0,
   0x210000a8,
   0x21004f64,
   0x00001670,
   0xe000e180,
   0x21000134,
   0x2100410f,
   0x00004089,
   0x00005b3f,
   0x21000108,
   0x21000160,
   0x00029de9,
   0x4801b403,
   0xbd019001,
   0x00003cc3,
   0x4801b403,
   0xbd019001,
   0x000075d1,
   0x4801b403,
   0xbd019001,
   0x00000fc1,
   0x4801b403,
   0xbd019001,
   0x00009361,
   0x4801b403,
   0xbd019001,
   0x0000069f,
   0x4801b403,
   0xbd019001,
   0x0000424f,
   0x4801b403,
   0xbd019001,
   0x0000423d,
   0x4801b403,
   0xbd019001,
   0x00007d65,
   0x4801b403,
   0xbd019001,
   0x00006655,
   0x4801b403,
   0xbd019001,
   0x00005d1b,
   0x4801b403,
   0xbd019001,
   0x00000c45,
   0x4801b403,
   0xbd019001,
   0x000085bd,
   0x4801b403,
   0xbd019001,
   0x00004e75,
   0x4801b403,
   0xbd019001,
   0x00004e4f,
   0x4801b403,
   0xbd019001,
   0x0000900f,
   0x4801b403,
   0xbd019001,
   0x00003ca9,
   0x4801b403,
   0xbd019001,
   0x00008303,
   0x4801b403,
   0xbd019001,
   0x000075f7,
   0x01000000,
   0x00000000,
   0x04050000,
   0x00000000,
   0x00000000,
   0x00000000,
   0x00000000,
   0x00000000,
   0x00000000,
   0x00000000,
};
#define _NWORD_PATCHIMAGE_IEEE_COEX 976

#define _NWORD_PATCHCPEHD_IEEE_COEX 0

#define _NWORD_PATCHSYS_IEEE_COEX 0

#define _IRQ_PATCH_0 0x210047d3
#define _IRQ_PATCH_1 0x210049a7
#define _IRQ_PATCH_2 0x21004a43
#define _IRQ_PATCH_3 0x21004b61
#define _IRQ_PATCH_4 0x21004c73


#ifndef _IEEE_COEX_SYSRAM_START
#define _IEEE_COEX_SYSRAM_START 0x20000000
#endif

#ifndef _IEEE_COEX_CPERAM_START
#define _IEEE_COEX_CPERAM_START 0x21000000
#endif

#define _IEEE_COEX_SYS_PATCH_FIXED_ADDR 0x20000000

#define _IEEE_COEX_PATCH_VEC_ADDR_OFFSET 0x03D0
#define _IEEE_COEX_PATCH_TAB_OFFSET 0x03D4
#define _IEEE_COEX_IRQPATCH_OFFSET 0x0480
#define _IEEE_COEX_PATCH_VEC_OFFSET 0x404C

#define _IEEE_COEX_PATCH_CPEHD_OFFSET 0x04E0

#ifndef _IEEE_COEX_NO_PROG_STATE_VAR
static uint8_t bIeeeCoexPatchEntered = 0;
#endif

PATCH_FUN_SPEC void enterIeeeCoexCpePatch(void)
{
#if (_NWORD_PATCHIMAGE_IEEE_COEX > 0)
   uint32_t *pPatchVec = (uint32_t *) (_IEEE_COEX_CPERAM_START + _IEEE_COEX_PATCH_VEC_OFFSET);

   memcpy(pPatchVec, patchImageIeeeCoex, sizeof(patchImageIeeeCoex));
#endif
}

PATCH_FUN_SPEC void enterIeeeCoexCpeHdPatch(void)
{
#if (_NWORD_PATCHCPEHD_IEEE_COEX > 0)
   uint32_t *pPatchCpeHd = (uint32_t *) (_IEEE_COEX_CPERAM_START + _IEEE_COEX_PATCH_CPEHD_OFFSET);

   memcpy(pPatchCpeHd, patchCpeHd, sizeof(patchCpeHd));
#endif
}

PATCH_FUN_SPEC void enterIeeeCoexSysPatch(void)
{
}

PATCH_FUN_SPEC void configureIeeeCoexPatch(void)
{
   uint8_t *pPatchTab = (uint8_t *) (_IEEE_COEX_CPERAM_START + _IEEE_COEX_PATCH_TAB_OFFSET);
   uint32_t *pIrqPatch = (uint32_t *) (_IEEE_COEX_CPERAM_START + _IEEE_COEX_IRQPATCH_OFFSET);


   pPatchTab[76] = 0;
   pPatchTab[140] = 1;
   pPatchTab[150] = 2;
   pPatchTab[164] = 3;
   pPatchTab[79] = 4;
   pPatchTab[78] = 5;
   pPatchTab[40] = 6;
   pPatchTab[57] = 7;

   pIrqPatch[15] = _IRQ_PATCH_0;
   pIrqPatch[19] = _IRQ_PATCH_1;
   pIrqPatch[17] = _IRQ_PATCH_2;
   pIrqPatch[21] = _IRQ_PATCH_3;
   pIrqPatch[11] = _IRQ_PATCH_4;
}

PATCH_FUN_SPEC void applyIeeeCoexPatch(void)
{
#ifdef _IEEE_COEX_NO_PROG_STATE_VAR
   enterIeeeCoexSysPatch();
   enterIeeeCoexCpePatch();
#else
   if (!bIeeeCoexPatchEntered)
   {
      enterIeeeCoexSysPatch();
      enterIeeeCoexCpePatch();
      bIeeeCoexPatchEntered = 1;
   }
#endif
   enterIeeeCoexCpeHdPatch();
   configureIeeeCoexPatch();
}

void refreshIeeeCoexPatch(void)
{
   enterIeeeCoexCpeHdPatch();
   configureIeeeCoexPatch();
}

void cleanIeeeCoexPatch(void)
{
#ifndef _IEEE_COEX_NO_PROG_STATE_VAR
   bIeeeCoexPatchEntered = 0;
#endif
}

void rf_patch_cpe_ieee_coex(void)
{
   applyIeeeCoexPatch();
}

#undef _IRQ_PATCH_0
#undef _IRQ_PATCH_1
#undef _IRQ_PATCH_2
#undef _IRQ_PATCH_3
#undef _IRQ_PATCH_4

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif


